﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FlowerModel;
using FlowerDAL;

namespace FlowerBLL
{
    public class AdminBLL
    {

        #region 管理员登录
        /// <summary>
        /// 登录方法
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="name"></param>
        /// <param name="pwd"></param>
        /// <returns></returns>
        public T AdminLogin<T>(string name, string pwd)
        {
            return BllFactory.NewAdminDAL().AdminLogin<T>(name, pwd);
        }
        #endregion

        #region 客户管理
        //客户管理
        public List<T> UsersList<T>()
        {
            return BllFactory.NewAdminDAL().UsersList<T>();
        }

        //修改客户的状态
        public int UpdateState(int state, int id)
        {
            return BllFactory.NewAdminDAL().UpdateState(state, id);
        }
        #endregion

        #region 显示员工信息
        /// <summary>
        /// 显示员工信息
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        public List<T> Employ<T>()
        {
            return BllFactory.NewAdminDAL().Employ<T>();
        }
        #endregion

        #region 显示角色
        /// <summary>
        /// 显示角色
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        public List<T> role<T>()
        {
            return BllFactory.NewAdminDAL().role<T>();
        }
        #endregion

        #region 添加员工信息
        /// <summary>
        /// 添加员工信息
        /// </summary>
        /// <param name="emp"></param>
        /// <returns></returns>
        public bool AddEmploy<T>(Employee emp)
        {
            return BllFactory.NewAdminDAL().AddEmploy<T>(emp);
        }
        #endregion

        #region MyRegion
        public int UpdateEmp<T>(int state , int id)
        {
            return BllFactory.NewAdminDAL().UpdateEmp<T>(state,id);
        }
        #endregion
    }
}
